package com.mico.micochange.client;

import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder;
import org.apache.mina.core.future.ConnectFuture;
import org.apache.mina.filter.codec.ProtocolCodecFilter;
import org.apache.mina.filter.codec.textline.TextLineCodecFactory;
import org.apache.mina.transport.socket.nio.NioSocketConnector;

import java.net.InetSocketAddress;
import java.nio.charset.Charset;

/**
 * mina客户端
 *
 * @author aniyo
 * blog:http://aniyo.iteye.com
 */
public class MinaClient {

    public static void main(String[] args) throws Exception {
        String limitOrder = "{\"counterSymbol\":\"USDT\",\"orderType\":\"00\",\"act\":\"limitOrder\",\"apiKey\":\"CykdmiEoJ2ooX6RW17K_qs-COXBEI1lxw7p3lmQz4C7Ieh2ZZnxJwTUc96UqL0zQmcM7OsmkD2NxWJKj153CUUQM1TF3jFPB_v-CnQGvk-h35PZ_qvdxisVUTATDP8d5onCPejchxX5bvW3BwtbTvh419qwFJb2LobQOq8ihNVg\",\"secretKey\":\"fiKheDzwjJ2kf7jjtz2gctnXFsTq_unp0XRGwB4ZuDrn0UoJxRO7pQCyjIyNihuJoP_1zcwU0jKciZrkwcBkSrJHhW7CzUKffn3jED8tUyyqofvMG9NHCvpPbsDl3bN9IiIeiJmoSw3SW_qflFYLS5DUnWzLlRhHib0oaubHhcU\",\"originalAmount\":\"2000\",\"limitPrice\":\"20000\",\"orderId\":\"16\",\"exchange\":\"huobi\",\"baseSymbol\":\"ETH\"}";
        String marketOrder = "{\"counterSymbol\":\"USDT\",\"orderType\":\"00\",\"act\":\"marketOrder\",\"apiKey\":\"CykdmiEoJ2ooX6RW17K_qs-COXBEI1lxw7p3lmQz4C7Ieh2ZZnxJwTUc96UqL0zQmcM7OsmkD2NxWJKj153CUUQM1TF3jFPB_v-CnQGvk-h35PZ_qvdxisVUTATDP8d5onCPejchxX5bvW3BwtbTvh419qwFJb2LobQOq8ihNVg\",\"secretKey\":\"fiKheDzwjJ2kf7jjtz2gctnXFsTq_unp0XRGwB4ZuDrn0UoJxRO7pQCyjIyNihuJoP_1zcwU0jKciZrkwcBkSrJHhW7CzUKffn3jED8tUyyqofvMG9NHCvpPbsDl3bN9IiIeiJmoSw3SW_qflFYLS5DUnWzLlRhHib0oaubHhcU\",\"originalAmount\":\"1000000\",\"orderId\":\"16\",\"exchange\":\"huobi\",\"baseSymbol\":\"ETH\"}";
        String getAcc = "{\"act\":\"getacc\",\"apiKey\":\"CykdmiEoJ2ooX6RW17K_qs-COXBEI1lxw7p3lmQz4C7Ieh2ZZnxJwTUc96UqL0zQmcM7OsmkD2NxWJKj153CUUQM1TF3jFPB_v-CnQGvk-h35PZ_qvdxisVUTATDP8d5onCPejchxX5bvW3BwtbTvh419qwFJb2LobQOq8ihNVg\",\"secretKey\":\"fiKheDzwjJ2kf7jjtz2gctnXFsTq_unp0XRGwB4ZuDrn0UoJxRO7pQCyjIyNihuJoP_1zcwU0jKciZrkwcBkSrJHhW7CzUKffn3jED8tUyyqofvMG9NHCvpPbsDl3bN9IiIeiJmoSw3SW_qflFYLS5DUnWzLlRhHib0oaubHhcU\",\"orderId\":\"16\",\"exchange\":\"huobi\"}";
        String getHadaxAcc = "{\"hadax\":\"1\",\"act\":\"getacc\",\"apiKey\":\"CykdmiEoJ2ooX6RW17K_qs-COXBEI1lxw7p3lmQz4C7Ieh2ZZnxJwTUc96UqL0zQmcM7OsmkD2NxWJKj153CUUQM1TF3jFPB_v-CnQGvk-h35PZ_qvdxisVUTATDP8d5onCPejchxX5bvW3BwtbTvh419qwFJb2LobQOq8ihNVg\",\"secretKey\":\"fiKheDzwjJ2kf7jjtz2gctnXFsTq_unp0XRGwB4ZuDrn0UoJxRO7pQCyjIyNihuJoP_1zcwU0jKciZrkwcBkSrJHhW7CzUKffn3jED8tUyyqofvMG9NHCvpPbsDl3bN9IiIeiJmoSw3SW_qflFYLS5DUnWzLlRhHib0oaubHhcU\",\"orderId\":\"16\",\"exchange\":\"huobi\"}";
        String getOrder = "{\"act\":\"getOrder\",\"apiKey\":\"CykdmiEoJ2ooX6RW17K_qs-COXBEI1lxw7p3lmQz4C7Ieh2ZZnxJwTUc96UqL0zQmcM7OsmkD2NxWJKj153CUUQM1TF3jFPB_v-CnQGvk-h35PZ_qvdxisVUTATDP8d5onCPejchxX5bvW3BwtbTvh419qwFJb2LobQOq8ihNVg\",\"secretKey\":\"fiKheDzwjJ2kf7jjtz2gctnXFsTq_unp0XRGwB4ZuDrn0UoJxRO7pQCyjIyNihuJoP_1zcwU0jKciZrkwcBkSrJHhW7CzUKffn3jED8tUyyqofvMG9NHCvpPbsDl3bN9IiIeiJmoSw3SW_qflFYLS5DUnWzLlRhHib0oaubHhcU\",\"orderId\":\"5850088873\",\"exchange\":\"huobi\"}";
        String cancelOrder = "{\"act\":\"cancelOrder\",\"apiKey\":\"CykdmiEoJ2ooX6RW17K_qs-COXBEI1lxw7p3lmQz4C7Ieh2ZZnxJwTUc96UqL0zQmcM7OsmkD2NxWJKj153CUUQM1TF3jFPB_v-CnQGvk-h35PZ_qvdxisVUTATDP8d5onCPejchxX5bvW3BwtbTvh419qwFJb2LobQOq8ihNVg\",\"secretKey\":\"fiKheDzwjJ2kf7jjtz2gctnXFsTq_unp0XRGwB4ZuDrn0UoJxRO7pQCyjIyNihuJoP_1zcwU0jKciZrkwcBkSrJHhW7CzUKffn3jED8tUyyqofvMG9NHCvpPbsDl3bN9IiIeiJmoSw3SW_qflFYLS5DUnWzLlRhHib0oaubHhcU\",\"orderId\":\"16\",\"exchange\":\"huobi\"}";
        String getDepth = "{\"counterSymbol\":\"USDT\",\"act\":\"getDepth\",\"apiKey\":\"CykdmiEoJ2ooX6RW17K_qs-COXBEI1lxw7p3lmQz4C7Ieh2ZZnxJwTUc96UqL0zQmcM7OsmkD2NxWJKj153CUUQM1TF3jFPB_v-CnQGvk-h35PZ_qvdxisVUTATDP8d5onCPejchxX5bvW3BwtbTvh419qwFJb2LobQOq8ihNVg\",\"secretKey\":\"fiKheDzwjJ2kf7jjtz2gctnXFsTq_unp0XRGwB4ZuDrn0UoJxRO7pQCyjIyNihuJoP_1zcwU0jKciZrkwcBkSrJHhW7CzUKffn3jED8tUyyqofvMG9NHCvpPbsDl3bN9IiIeiJmoSw3SW_qflFYLS5DUnWzLlRhHib0oaubHhcU\",\"orderId\":\"16\",\"exchange\":\"huobi\",\"baseSymbol\":\"ETH\"}";
        String getAssetPairs = "{\"hadax\":\"1\",\"act\":\"getAssetPairs\",\"apiKey\":\"CykdmiEoJ2ooX6RW17K_qs-COXBEI1lxw7p3lmQz4C7Ieh2ZZnxJwTUc96UqL0zQmcM7OsmkD2NxWJKj153CUUQM1TF3jFPB_v-CnQGvk-h35PZ_qvdxisVUTATDP8d5onCPejchxX5bvW3BwtbTvh419qwFJb2LobQOq8ihNVg\",\"secretKey\":\"fiKheDzwjJ2kf7jjtz2gctnXFsTq_unp0XRGwB4ZuDrn0UoJxRO7pQCyjIyNihuJoP_1zcwU0jKciZrkwcBkSrJHhW7CzUKffn3jED8tUyyqofvMG9NHCvpPbsDl3bN9IiIeiJmoSw3SW_qflFYLS5DUnWzLlRhHib0oaubHhcU\",\"exchange\":\"huobi\"}";
        String getticket = "{\"counterSymbol\":\"USDT\",\"act\":\"getticket\",\"apiKey\":\"CykdmiEoJ2ooX6RW17K_qs-COXBEI1lxw7p3lmQz4C7Ieh2ZZnxJwTUc96UqL0zQmcM7OsmkD2NxWJKj153CUUQM1TF3jFPB_v-CnQGvk-h35PZ_qvdxisVUTATDP8d5onCPejchxX5bvW3BwtbTvh419qwFJb2LobQOq8ihNVg\",\"secretKey\":\"fiKheDzwjJ2kf7jjtz2gctnXFsTq_unp0XRGwB4ZuDrn0UoJxRO7pQCyjIyNihuJoP_1zcwU0jKciZrkwcBkSrJHhW7CzUKffn3jED8tUyyqofvMG9NHCvpPbsDl3bN9IiIeiJmoSw3SW_qflFYLS5DUnWzLlRhHib0oaubHhcU\",\"exchange\":\"huobi\",\"baseSymbol\":\"ETH\"}";
        String gethadaxticket = "{\"hadax\":\"1\",\"counterSymbol\":\"ETH\",\"act\":\"getticket\",\"apiKey\":\"CykdmiEoJ2ooX6RW17K_qs-COXBEI1lxw7p3lmQz4C7Ieh2ZZnxJwTUc96UqL0zQmcM7OsmkD2NxWJKj153CUUQM1TF3jFPB_v-CnQGvk-h35PZ_qvdxisVUTATDP8d5onCPejchxX5bvW3BwtbTvh419qwFJb2LobQOq8ihNVg\",\"secretKey\":\"fiKheDzwjJ2kf7jjtz2gctnXFsTq_unp0XRGwB4ZuDrn0UoJxRO7pQCyjIyNihuJoP_1zcwU0jKciZrkwcBkSrJHhW7CzUKffn3jED8tUyyqofvMG9NHCvpPbsDl3bN9IiIeiJmoSw3SW_qflFYLS5DUnWzLlRhHib0oaubHhcU\",\"exchange\":\"huobi\",\"baseSymbol\":\"BTC\"}";


        String balimitOrder = "{\"counterSymbol\":\"USDT\",\"orderType\":\"00\",\"act\":\"limitOrder\",\"apiKey\":\"8bcYzuqRdJnyaldjOQcGiU6Ew7M6IBSjbmYT42jpvF7qt8PPxlebwimfDyuQjdOq\",\"secretKey\":\"tM9vEtv4lOwjJqo3almZVOVSTdxPWjO1LhFL9buyZrwE0AaN8ejqHm3IFm5aXVxn\",\"originalAmount\":\"10\",\"limitPrice\":\"1\",\"orderId\":\"16\",\"exchange\":\"binance\",\"baseSymbol\":\"ETH\"}";
        String bamarketOrder = "{\"counterSymbol\":\"USDT\",\"orderType\":\"00\",\"act\":\"marketOrder\",\"apiKey\":\"8bcYzuqRdJnyaldjOQcGiU6Ew7M6IBSjbmYT42jpvF7qt8PPxlebwimfDyuQjdOq\",\"secretKey\":\"tM9vEtv4lOwjJqo3almZVOVSTdxPWjO1LhFL9buyZrwE0AaN8ejqHm3IFm5aXVxn\",\"originalAmount\":\"0.001\",\"orderId\":\"16\",\"exchange\":\"binance\",\"baseSymbol\":\"ETH\"}";
        String bagetAcc = "{\"counterSymbol\":\"USDT\",\"orderType\":\"00\",\"act\":\"getacc\",\"apiKey\":\"8bcYzuqRdJnyaldjOQcGiU6Ew7M6IBSjbmYT42jpvF7qt8PPxlebwimfDyuQjdOq\",\"secretKey\":\"tM9vEtv4lOwjJqo3almZVOVSTdxPWjO1LhFL9buyZrwE0AaN8ejqHm3IFm5aXVxn\",\"exchange\":\"binance\"}";
        String bagetOrder = "{\"act\":\"getOrder\",\"apiKey\":\"JlN6vnuxAXW7ICm2LhKjBg2ryjTTXDdSrbi8WPJe9pgwKjuMBTmxzU8yqyw6El1YmfioJwQPHexaFAxKRJWsbBDSXJiA2qu0rjAt9dViY8y_Dul4OTWCeSDoDLUnkiz0KUCvqgaRh6r9Ttn8Z6FvkoJiM6zncts5bJsfDtg4s6k\",\"secretKey\":\"DnDFaqF-_JAZuJKZ1GFzt_jFwTFJ1I_o6vSPt8E3x6OKDhS52R6fDzTHeRkNlE5lIICdB5FLmcJWpfyqN1BPMPTO8p9wGcVrIfwv25nbBNoqOncUPBdB5PzclBD0_PBIPj1uZD66pIosQG6nVrle3hjLV6L1Kja_Z3F6H2Y92Kw\",\"orderId\":\"\",\"exchange\":\"binance\",\"counterSymbol\":\"USDT\",\"baseSymbol\":\"ETH\"}";
        String bacancelOrder = "{\"act\":\"cancelOrder\",\"apiKey\":\"8bcYzuqRdJnyaldjOQcGiU6Ew7M6IBSjbmYT42jpvF7qt8PPxlebwimfDyuQjdOq\",\"secretKey\":\"tM9vEtv4lOwjJqo3almZVOVSTdxPWjO1LhFL9buyZrwE0AaN8ejqHm3IFm5aXVxn\",\"orderId\":\"67205149\",\"exchange\":\"binance\",\"counterSymbol\":\"USDT\",\"baseSymbol\":\"ETH\"}";
        String bagetDepth = "{\"counterSymbol\":\"USDT\",\"act\":\"getDepth\",\"apiKey\":\"8bcYzuqRdJnyaldjOQcGiU6Ew7M6IBSjbmYT42jpvF7qt8PPxlebwimfDyuQjdOq\",\"secretKey\":\"tM9vEtv4lOwjJqo3almZVOVSTdxPWjO1LhFL9buyZrwE0AaN8ejqHm3IFm5aXVxn\",\"exchange\":\"binance\",\"baseSymbol\":\"ETH\"}";
        String askMarketOrder = "{\"counterSymbol\":\"USDT\",\"orderType\":\"01\",\"act\":\"marketOrder\",\"apiKey\":\"JlN6vnuxAXW7ICm2LhKjBg2ryjTTXDdSrbi8WPJe9pgwKjuMBTmxzU8yqyw6El1YmfioJwQPHexaFAxKRJWsbBDSXJiA2qu0rjAt9dViY8y_Dul4OTWCeSDoDLUnkiz0KUCvqgaRh6r9Ttn8Z6FvkoJiM6zncts5bJsfDtg4s6k\",\"secretKey\":\"DnDFaqF-_JAZuJKZ1GFzt_jFwTFJ1I_o6vSPt8E3x6OKDhS52R6fDzTHeRkNlE5lIICdB5FLmcJWpfyqN1BPMPTO8p9wGcVrIfwv25nbBNoqOncUPBdB5PzclBD0_PBIPj1uZD66pIosQG6nVrle3hjLV6L1Kja_Z3F6H2Y92Kw\",\"originalAmount\":\"0.00001\",\"orderId\":\"166\",\"exchange\":\"binance\",\"baseSymbol\":\"ETH\"}";
        String bagetAssetPairs = "{\"act\":\"getAssetPairs\",\"apiKey\":\"JlN6vnuxAXW7ICm2LhKjBg2ryjTTXDdSrbi8WPJe9pgwKjuMBTmxzU8yqyw6El1YmfioJwQPHexaFAxKRJWsbBDSXJiA2qu0rjAt9dViY8y_Dul4OTWCeSDoDLUnkiz0KUCvqgaRh6r9Ttn8Z6FvkoJiM6zncts5bJsfDtg4s6k\",\"secretKey\":\"DnDFaqF-_JAZuJKZ1GFzt_jFwTFJ1I_o6vSPt8E3x6OKDhS52R6fDzTHeRkNlE5lIICdB5FLmcJWpfyqN1BPMPTO8p9wGcVrIfwv25nbBNoqOncUPBdB5PzclBD0_PBIPj1uZD66pIosQG6nVrle3hjLV6L1Kja_Z3F6H2Y92Kw\",\"exchange\":\"binance\"}";

        String chaogetacc = "{\"act\":\"getacc\",\"loginPwd\":\"PiiAbDtopHxw5nKtdMGmW11mwov0H9a70T4XG0CzL8sASc6NtGhhDD2iNpgyYucTZqilPhCvcgK8VHiu6UTJrScse2wWMzEJHepOixsMAkQIPLVNfnOAnFE-asikgDeYnpfyW-frp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xFwxvo1aBZ7nnY8IVkMKLNw772MW_BSouE30jWAiayXR-IHFmhOiWQ19XOdvckdeWGxujSeSNEsJOqBpLtfhrUDRxBY7Slzls2j6Hj2qTi8SqGbz9fkfo56yx7SPwzXLdTzrBJtLa26gtL7LMn6kV-EZ8Dk-_bd-oZpJCnjX-Rvn5ALGjdYBW5Eu6vEpA-CF_wfW-gvGqsB3WuTkP3T5OQa4Jt9fREMJXCXQT2pJeljg2bAPUQz8a_yqQd-aThquLGYg_VTzPEgvDiyDNoKzYx0_4fQQFLDePc71LIUyBZ0Z2ds5wGLZPmTDw6z72OIFne8eAA0XV26Yq7LpizrdbQuthqiM4BJ7tK03ttsrg1GPw60uk2BUaU2LG-cZ27oI7c4PBpGxLp1m_R2SKdmd_X5Zsu4u4sfrTgham7wlvOG9LdoBMN3GPjY1gyMFOEh-uu1kYBht2VaWqCIEn_UE-_HbCqhrv7ZrTU86k10pi-BO85hckcDAnXoWWzMLQuuBK6fwYEUjrpWusK5Cj_fO6iwNkM2dXQvA10tp_q7Aejk1mmoD3GVPzK0S6iN55t1DVdf-0vFzWO1EXZzuLSsXCd27KZT1YVajWqpINUNyXDlMuAAjqTDmw7_HwSqiMg\",\"exchange\":\"ck\"}";
        String chaolimitorder = "{\"counterSymbol\":\"CODE\",\"orderType\":\"00\",\"act\":\"limitOrder\",\"loginPwd\":\"PiiAbDtopHxw5nKtdMGmW11mwov0H9a70T4XG0CzL8sASc6NtGhhDD2iNpgyYucTZqilPhCvcgK8VHiu6UTJrScse2wWMzEJHepOixsMAkQIPLVNfnOAnFE-asikgDeYnpfyW-frpVwvvEKIph3gUxJ0c1Plvlw0mLdKvHkwPN4\",\"apiKey\":\"RjHhDtnPxzSim_V0iBD1M4-ii5q4ziMDmm9MeK79lOVvKiSjxsRcSLTxdxA3Y7vxE-AMtI5M1qAMaWnCJ0mGm25Ge0HKLMdxoph_BDngSGRugTIh0WHccVs1HZynrOw8z0LIdqZDjhlW7RzG2uhHet6dAAfwT-n6V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j5t1SNGLzHy9lisks7EdB5Ymn2Rc4z0ehm8z5M1d5p6PDXobLzW1oaVK8HZ4GjtNWBS62B1oDg3rL3gAvl5MtyZW2CnmHpmAMdGexq9R39kV2OhBzSHaScLH0h33nuPglON8jQP-ll3thfsxk5mtbZR2HitDxN8OulbGOrbN0kQaC2cAWHk47LFCQxwBbzfRy7Oi__rcUfpV3oHsnijuVDLGpkzaEg35Bg1kNXri9Nj-9SHF850kLUeGp46kgRza1g94iEvfMmaOukhYAUGngDJcZsd5Lvgz0OD1rWKJi5SPiw\",\"originalAmount\":\"2\",\"limitPrice\":\"1\",\"orderId\":\"733\",\"exchange\":\"ck\",\"baseSymbol\":\"EOS\"}";
        String chaogetorder = "{\"counterSymbol\":\"CODE\",\"date\":\"2018-07-06\",\"act\":\"getOrder\",\"loginPwd\":\"N98-8Cn9wNbiPktHPOiZOfyFicht_ny8Lot-xGZ87ClKfUNmnVRGg0oB42aqVGVUJRSpCnl4AqQyNpzcQDVzrlqgDZPZJqryII65_6iJUaMo23K4246nGfv8FKePNLtO_dlKxqWXGHYH0kJhwgINk5qlEzvC88FsxiWnjeboomA\",\"apiKey\":\"Nmo5gDdzOpbKB_8XI92HQf7otKEXTzdMCU1iuFDhscN-YuZOkma1-g_rmW3EwMpDq1gOIcc4AZ7WC70HuKGq1I0DJXHGfY_LgrvAbjif2gYtOGOBVUsgOtikVCx21Y_Mot_UA8Fa4ZTK39JfHbmp2xddsyPBbeujEGGR4crIMdE\",\"secretKey\":\"Kq6AMoxszLqntYyvvaynso0IfjejsSZZxF-AzH-6CJWzoKxM1Vmyoq1-u9rHh_RZZ_OONlhpdOnRulpqm9U68miXW3odbcThWWRHV0nGAn_7VBLNnBJCCr7dMNpsHkYjtttkgigo003VqVbiCIXUkzXp3Np4qYMm1QU9W7K2oz6Dfe1QF7oqSpZ3-9UHxNWoc0p78QshbZJ5cDEJJIEk8aqllDg3Dla8c_3CskGwatM_l4_BEv8ghtfuHJ7R7kSpyAK0cEYBynO8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daVU0Kljj_x6vDw\",\"orderId\":\"15308458634388782390421103144638\",\"exchange\":\"ck\",\"baseSymbol\":\"BAT\"}";

        String mes = "{ \"counterSymbol\": \"CHEX\", \"orderType\": \"00\",\"act\": \"limitOrder\",\"loginPwd\": \"PiiAbDtopHxw5nKtdMGmW11mwov0H9a70T4XG0CzL8sASc6NtGhhDD2iNpgyYucTZqilPhCvcgK8VHiu6UTJrScse2wWMzEJHepOixsMAkQIPLVNfnOAnFE-asikgDeYnpfyW-frpVwvvEKIph3gUxJ0c1Plvlw0mLdKvHkwPN4\",\n" +
                " \"apiKey\": \"RjHhDtnPxzSim_V0iBD1M4-ii5q4ziMDmm9MeK79lOVvKiSjxsRcSLTxdxA3Y7vxE-AMtI5M1qAMaWnCJ0mGm25Ge0HKLMdxoph_BDngSGRugTIh0WHccVs1HZynrOw8z0LIdqZDjhlW7RzG2uhHet6dAAfwT-n6VHWnxJFgT04\",\n" +
                " \"secretKey\": \"WEY12If8wgeuAcYVFVrfDjQz5vElygeLQAHgEVF0_IfH7mht3jhQwlY7-JWCOtWsOAwsImuhqDDAfonGq9OJMkRViQzSz6wXw8BXDmxm4mdTxqEIXcVUVelWxVJs1p1RTwdcY7crUH8Z4qdGI7uFysLlR3Czwk_vJ-Wj1OKsSUAnibub0VuvRNoH8BgKTWxX7-sexQKZm90ZU6_D_qd8nUHXSECkYoFPVsDM2s9m5FUzDnXLU4xVaylnk27874scnlw5EXcjCgnNZGmD95CuHQTr34S_ALqK0gsn80knAEEEutm1YRdJgKgLx2elcsPe1ZDep19VVldQ1BlmB_qjGChky1cyoM-aMYPuieH1zdRQZGTDaiD7pRuR8q6Zea3idHmEykUdgc0dOsJ8euSYR_mcIx6rR3ePOrvsJsdAMJMZI32v0-CbJKoEqFEuQypMURA31BbRMAc6S4rDBT6i39rAedS5qAzXRm70nFpii14hgAQKLLXtH6RzfEuItLeJeqU3zXM0H27g2aM9sDfnC1GydES70yAJpfnbHJ77kN6iDcxJH04qglFI86CIdQi5T4xLHkyjnC1Tl75dBh89i2oDVmjCKbQXeJMthUpJzaC_X3jqZpm4l_wF0lC7mtUKNbYq2DczhwOw_UEOfoaowymxymawhPlfg18YNCsWHM2IKU4eUR4phsK---iS18KIswM0ilEAyJgYYvr6grBxCazS0E1WPWjWxnUCEwxGSCpFRLtB6gvuZvmPvBD0jujEIvVTd-9VIBFJAeV5uC8h60BCBfDhpcKo6alRsgebvF6zJxU6rwbLYPJ0vBjtpMZLaQiaTP24GoC3yGezDG4Ugi2HTJwXB9O7Dhkaoo5Qdx9A9NItBAMQLEfvgWaGLqt5uqpPpsiOxxNAh9FBHTkhv-ndzkQ4wHrtoLCZgGtZ-2AnRP-QBYSLNXmIrSe6SG2KQhTSWbm9ZhgdqoZx9wAtgSUaS9WZly-xGpW0TIKXyFUO9Stm5Q7mT1axwz3ZhtEeSpbGkuRLHO4LPuq_hRNX5u8IhdgaMO8rOzPFJf9-j5t1SNGLzHy9lisks7EdB5Ymn2Rc4z0ehm8z5M1d5p6PDXobLzW1oaVK8HZ4GjtNWBS62B1oDg3rL3gAvl5MtyZW2CnmHpmAMdGexq9R39kV2OhBzSHaScLH0h33nuPglON8jQP-ll3thfsxk5mtbZR2HitDxN8OulbGOrbN0kQaC2cAWHk47LFCQxwBbzfRy7Oi__rcUfpV3oHsnijuVDLGpkzaEg35Bg1kNXri9Nj-9SHF850kLUeGp46kgRza1g94iEvfMmaOukhYAUGngDJcZsd5Lvgz0OD1rWKJi5SPiw\",\n" +
                " \"originalAmount\": \"2.58787787\",\"limitPrice\": \"1.60213002\",\"orderId\": \"875\",\"exchange\": \"ck\",\"baseSymbol\": \"VCT\"\n" +
                "}";
        String test = "{\"act\":\"getacc\",\"apiKey\":\"CykdmiEoJ2ooX6RW17K_qs-COXBEI1lxw7p3lmQz4C7Ieh2ZZnxJwTUc96UqL0zQmcM7OsmkD2NxWJKj153CUUQM1TF3jFPB_v-CnQGvk-h35PZ_qvdxisVUTATDP8d5onCPejchxX5bvW3BwtbTvh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waFp1A1eNf2muFXa9Z2eWbEdYi7urHH3Y0JCBoPRrMak8B3Dfmc3Dut5nH6PB4wg_8mc4glQ9PaGJLknPVoeklV7v82k0N4MCiHqoEOWPf4sUyikZhTjo8nUA39Zsmj6JZ7tF2r2W1W0yBl2noMTGp2maQ71TiMire5t__J0vWM9cSg9hV6WwiUADFXoGzydLZ7THI7EntkHw3uDRjWxBJ4Cw1rEUPjmm0yDFx5tqNL2qlpZ3XgOVOpZjDUF7af6jDBhH-49pRbdOC4obnusa_6mLCjmNxFwxvo1aBZ7nnY8IVkMKLNw772MW_BSouE30jWAiayXR-IHFmhOiWQ19XOdvckdeWGxujSeSNEsJOqBpLtfhrUDRxBY7Slzls2j6Hj2qTi8SqGbz9fkfo56yx7SPwzXLdTzrBJtLa26gtL7LMn6kV-EZ8Dk-_bd-oZpJCnjX-Rvn5ALGjdYBW5Eu6vEpA-CF_wfW-gvGqsB3WuTkP3T5OQa4Jt9fREMJXCXQT2pJeljg2bAPUQz8a_yqQd-aThquLGYg_VTzPEgvDiyDNoKzYx0_4fQQFLDePc71LIUyBZ0Z2ds5wGLZPmTDw6z72OIFne8eAA0XV26Yq7LpizrdbQuthqiM4BJ7tK03ttsrg1GPw60uk2BUaU2LG-cZ27oI7c4PBpGxLp1m_R2SKdmd_X5Zsu4u4sfrTgham7wlvOG9LdoBMN3GPjY1gyMFOEh-uu1kYBht2VaWqCIEn_UE-_HbCqhrv7ZrTU86k10pi-BO85hckcDAnXoWWzMLQuuBK6fwYEUjrpWusK5Cj_fO6iwNkM2dXQvA10tp_q7Aejk1mmoD3GVPzK0S6iN55t1DVdf-0vFzWO1EXZzuLSsXCd27KZT1YVajWqpINUNyXDlMuAAjqTDmw7_HwSqiMg\",\"exchange\":\"ck\"}";
        sendMessage(chaogetAssetPairs);
        String ckcancelOrder = "{\"counterSymbol\":\"BTC\",\"act\":\"cancelOrder\",\"loginPwd\":\"N2-dBKCOrmg-GIoMQe_QsMaHqh0J8IDJsNl48ePQnFlr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kYRqY5qpWpzp1DSozj412ckoaN0CWzG3zJ16QbtajxPccfy6qNL5pJR7oeVKxQvaeidrNTpVlcOZ6cQkg1CwkvxFdIMKnim9IWFjVO83E2932zwqZzhhrQEp1MpWF01478qdOXSfltDe0RsoQbs_0UIIBkgHVkKxEHdo1RSCu690bgFuf9x9AS5o3NHbseEr4k_FFziHhurCUaWwfgbQpkWGydKfCjyPopMxMbS9YbNTBUeKcT6OzIpuGv6gZiaP-abvkkdXZcJLDXBUhrIYeYhrAnQGrW7mdfZionzSXj1S1tXD4bnEZcHqzmc-5saQTqSqWEKyhDY-VNwJ7IIZsLXM-RjQpY8v0MWVla1AbkdSmSYcbNbleCYEON0NOgLSaMKm6zqS7APDi6cHTnWCX2pRyT6WJj6WJNKY_DhNU5IEyOT58iPWgGBl62aXXvj6c6f_6gIK6iZ64mpPJvStFrNBIhgHMfLkHNpfgK__Y37ikunydiy0vO8v7sS8whbcigdnr3f7tLqZoHTQfkC7OxY_Il8xnQINkUvX7zeFo2GgeVYWFxC1OmBsqExd5on4O8arcPuSQB4i-kV2Yx92nOAh5Tv9AdaVU0Kljj_x6vDw\",\"orderId\":\"15337146215380032350351101016990\",\"exchange\":\"ck\",\"baseSymbol\":\"NULS\"}";

        String sendMsg = "{\"act\":\"sendMsg\",\"exchange\":\"mico\",\"msgType\":\"steInf\",\"phoneNum\":\"15001182426\",\"stfName\":\"test\",\"dealTime\":\"123\",\"coinType\":\"22\",\"dealPrice\":\"11\"}";
        String sendMsgV = "{\"act\":\"sendMsg\",\"exchange\":\"mico\",\"msgType\":\"verCode\",\"phoneNum\":\"15001182426\",\"verCode\":\"456\"}";


        String fcgetbalance = "{\"act\":\"getacc\",\"apiKey\":\"R8IpN90AabCDzQCEsNbI9iH4tNCQoIhtnXTVXNvGamcUtw_Hwp0y5j__vjxsaW25XDwpRLeObjMXalOFJIHbLvTkeAi2cb5YBF8Ui34nHlns0Y7sElMxSWmFfZWvNKNoemngmm2Y5GSsDbW4KfET6kDMs_rEqPyWQ8YAHfuHZDw\",\"secretKey\":\"dZcHEA6OV7da13p_y0G_wLgnuFzvxTPTf30Ept9U1cVX6CqAdgF-tGyartyEJ9M7pdbuVwOxkeMOcNIO737Pz-Wxcp0taNGvLtPhnD7GwvQa6GxF94hGd00oF5_58L9y0KXffz3zxJX8jCr89yg2Xggh0dpVQs-e2QIKLRQmE2I\",\"exchange\":\"fc\"}";

        sendMessage(ckcancelOrder);


        String str = "";
    }

    public static void sendMessage(String message) {
        //Create TCP/IP connection
        NioSocketConnector connector = new NioSocketConnector();

        //创建接受数据的过滤器
        DefaultIoFilterChainBuilder chain = connector.getFilterChain();
        //设定这个过滤器将一行一行(/r/n)的读取数据
        TextLineCodecFactory textLineCodeFactory = new TextLineCodecFactory(Charset.forName("UTF-8"));
        textLineCodeFactory.setDecoderMaxLineLength(16144);
        textLineCodeFactory.setEncoderMaxLineLength(6144);
        chain.addLast("myChin", new ProtocolCodecFilter(textLineCodeFactory));

        //客户端的消息处理器：一个SamplMinaServerHander对象
        connector.setHandler(new MinaClientHandler(message));

        //set connect timeout
        connector.setConnectTimeout(5000);

        //连接到服务器：
        ConnectFuture cf = connector.connect(new InetSocketAddress("119.28.133.210", 18091));
//        ConnectFuture cf = connector.connect(new InetSocketAddress("207.148.111.58",18091));
//        ConnectFuture cf = connector.connect(new InetSocketAddress("localhost",18091));

//        Wait for the connection attempt to be finished.
        cf.awaitUninterruptibly();

        cf.getSession().getCloseFuture().awaitUninterruptibly();

        connector.dispose();
    }
}